/*    */ package com.wgcloud.service;
/*    */ 
/*    */ import com.github.pagehelper.PageHelper;
/*    */ import com.github.pagehelper.PageInfo;
/*    */ import com.wgcloud.entity.FileSafe;
/*    */ import com.wgcloud.mapper.FileSafeMapper;
/*    */ import com.wgcloud.util.DateUtil;
/*    */ import com.wgcloud.util.UUIDUtil;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ import org.apache.commons.lang3.StringUtils;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ import org.springframework.stereotype.Service;
/*    */ import org.springframework.transaction.annotation.Transactional;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ @Service
/*    */ public class FileSafeService
/*    */ {
/*    */   @Autowired
/*    */   private FileSafeMapper fileSafeMapper;
/*    */   
/*    */   public PageInfo selectByParams(Map<String, Object> params, int currPage, int pageSize) throws Exception {
/* 29 */     PageHelper.startPage(currPage, pageSize);
/* 30 */     List<FileSafe> list = this.fileSafeMapper.selectByParams(params);
/* 31 */     PageInfo<FileSafe> pageInfo = new PageInfo(list);
/* 32 */     return pageInfo;
/*    */   }
/*    */   
/*    */   public void save(FileSafe fileSafe) throws Exception {
/* 36 */     fileSafe.setId(UUIDUtil.getUUID());
/* 37 */     fileSafe.setCreateTime(DateUtil.getNowTime());
/* 38 */     if (!StringUtils.isEmpty(fileSafe.getFileSign())) {
/* 39 */       fileSafe.setFileSign(fileSafe.getFileSign().trim());
/*    */     }
/* 41 */     this.fileSafeMapper.save(fileSafe);
/*    */   }
/*    */   
/*    */   public int deleteByHostName(Map<String, Object> map) throws Exception {
/* 45 */     return this.fileSafeMapper.deleteByHostName(map);
/*    */   }
/*    */   
/*    */   @Transactional
/*    */   public void saveRecord(List<FileSafe> recordList) throws Exception {
/* 50 */     if (recordList.size() < 1) {
/*    */       return;
/*    */     }
/* 53 */     for (FileSafe as : recordList) {
/* 54 */       as.setId(UUIDUtil.getUUID());
/*    */     }
/* 56 */     this.fileSafeMapper.insertList(recordList);
/*    */   }
/*    */   
/*    */   public void downByHostName(List<String> recordList) throws Exception {
/* 60 */     if (recordList.size() < 1) {
/*    */       return;
/*    */     }
/* 63 */     this.fileSafeMapper.downByHostName(recordList);
/*    */   }
/*    */   
/*    */   public int countByParams(Map<String, Object> params) throws Exception {
/* 67 */     return this.fileSafeMapper.countByParams(params);
/*    */   }
/*    */   
/*    */   @Transactional
/*    */   public int deleteById(String[] id) throws Exception {
/* 72 */     return this.fileSafeMapper.deleteById(id);
/*    */   }
/*    */   
/*    */   @Transactional
/*    */   public void updateRecord(List<FileSafe> recordList) throws Exception {
/* 77 */     if (recordList.size() < 1) {
/*    */       return;
/*    */     }
/* 80 */     this.fileSafeMapper.updateList(recordList);
/*    */   }
/*    */ 
/*    */   
/*    */   public void updateById(FileSafe fileSafe) throws Exception {
/* 85 */     this.fileSafeMapper.updateById(fileSafe);
/*    */   }
/*    */   
/*    */   public FileSafe selectById(String id) throws Exception {
/* 89 */     return this.fileSafeMapper.selectById(id);
/*    */   }
/*    */   
/*    */   public List<FileSafe> selectAllByParams(Map<String, Object> params) throws Exception {
/* 93 */     return this.fileSafeMapper.selectAllByParams(params);
/*    */   }
/*    */ }


/* Location:              /Users/zhangyongxin/soft-install/wgcloud/wgcloud-v3.3.5/server/bank/wgcloud-server-release.jar!/BOOT-INF/classes/com/wgcloud/service/FileSafeService.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */